<?php
require_once("../includes/config.inc.php");
validate_admin();

if($_POST)
{
	@extract($_POST);
	if(is_array($chkIds))
	{
		$strIds =  @implode(",",$chkIds);
		
		if($Submit == 'Active')
		{
			$sqlA = " update tbl_nl_template set status = 1 where templateId in ($strIds) ";
			executeQuery($sqlA);
			$_SESSION['sessMsg'] = " Selected Record(s) Are Now Active. ";
			header("location: nlTemplateManager.php");
			exit();
		}
		
		if($Submit == 'Inactive')
		{
			$sqlA = " update tbl_nl_template set status = 0 where templateId in ($strIds) ";
			executeQuery($sqlA);
			$_SESSION['sessMsg'] = " Selected Record(s) Are Now Inactive. ";
			header("location: nlTemplateManager.php");
			exit();
		}
		
		if($Submit == 'Delete')
		{
			$sqlA = " delete from tbl_nl_template where templateId in ($strIds) ";
			executeQuery($sqlA);
			$_SESSION['sessMsg'] = " Selected Record(s) Are Deleted Successfully. ";
			header("location: nlTemplateManager.php");
			exit();
		}
	}
	else
	{
		$_SESSION['sessMsg'] = " Please select at least one checkbox for desire action. ";
		header("location: nlTemplateManager.php");
		exit;
	}
}

$sqlPL = " select * from tbl_nl_template  order by templateId asc ";
$resPL = executeQuery(dopaging($sqlPL,25));

?>